<?php

include("classes/include.php");

session_start();

if(isset($_GET['action']))
{
	if($_GET['action'] == "deco")
	{
		session_destroy();
	}
}

if(isset($_POST['id_id']) && isset($_POST['id_ps']))
{

	$login = $_POST['id_id'];
	$mdp = $_POST['id_ps'];

	//$utilisateur = new Etudiant();

	$mess = Utilisateur::identifierInternaute($login,$mdp);
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>ActuStage</title>
	<link href="css/style.css" rel="stylesheet" type="text/css" />
       <link href="css/calendar.css" type="text/css" rel="stylesheet" />
    <script src="scripts/calendar.js"></script>
</head>

<body>

	<div id="container">
		<div id="bandeau">
			<a href="index.php"><img src="images/banniere.jpg" width="906" height="110" alt="" /></a> 
         
            <div id="adh">
               <?php 
             	if(!isset($_SESSION['utilisateur']))
            	{
					?>
				<form action="depotsOffre.php" method="post">
                <span style="font-variant: small-caps;color:#FFF;margin-right:5px;font-size:9pt;"> Espace utilisateur</span>
					<input id="identifiant" name="id_id" class="input" value="Nom d'utilisateur" onClick="effacerid();" onblur="remplirid();" style="height:10px;font-size:8pt;" />
					<input id="mot_de_passe" name="id_ps" type="password" value="Mot de passe" onClick="effacermdp();" onblur="remplirmdp();" class="input" style="height:10px;font-size:8pt;" />
					<input type="submit" value="ok" style="font-size:8pt;" alt="" />
				</form>
				<script type="text/javascript">
					function effacerid(){
						document.getElementById( 'identifiant' ).value = "" ;
					}
					function effacermdp(){
						document.getElementById( 'mot_de_passe' ).value = "" ;
					}
					function remplirid(){
						if (!document.getElementById( 'identifiant' ).value){
							document.getElementById( 'identifiant' ).value = "Nom d'utilisateur";}
					}
					function remplirmdp(){
						if (!document.getElementById( 'mot_de_passe' ).value ){
							document.getElementById( 'mot_de_passe' ).value = "Mot de passe" ;}
					}
	
				
				</script>
                    <?php
				}
				else
				if(isset($_SESSION['utilisateur']))
            	{
					$nom = $_SESSION['utilisateur']->getNomUtilisateur();
					$prenom = $_SESSION['utilisateur']->getPrenomUtilisateur();
					?>
					<span style="font-variant: normal-caps;color:#FFF;margin-right:232px;font-size:10pt;"><?php echo 'Bienvenue ', $prenom,' ', $nom; ?></span>
                    <?php                   
				}
			?>
			</div>
        
		</div>
    	<div class="clear"></div>
      	<?php   
    include("menu.php");
    ?>
		<div id="contenu">
			<div id="texteaccueil">
         		<div id="titreAcceuil">
       				 <h2>Déposer une offre <br /> <img src="images/traitBleu.png"width="700" height="3" alt="" /></h2>
       			</div>
        <div id="texte">
        <div id="depot">
        <form action="executeDepotOffre.php" method="post" onsubmit="return verifForm();">
	<table bgcolor="#E4E4E4">
	  <tbody>
			<tr>
				<td width="413" class="cf"><h3>Entreprise </h3></td>
				<td colspan="3" class="cf">&nbsp;</td>
			</tr>
            <tr>
				<td width="413" style="padding-left:5px;"  class="f"><label for="fent" >Nom de l'entreprise *</label></td>
				<td width="477" class="f">  <input size="50" maxlength="50" name="fent" id="flent" type="text" /></td>
			</tr>
			<tr>
				<td style="padding-left:5px;" class="tf"><label for="fad">Adresse *</label></td>
				<td colspan="3" class="f"><input size="50" maxlength="50" id="fad" name="fle1ad1" type="text"></td>
			</tr>
			<tr>
				<td style="padding-left:5px;" class="tf">&nbsp;</td>
				<td colspan="3" class="f"><input size="50" maxlength="50" id="fad2" name="fle1ad2" type="text"></td>
			</tr>
		
			<tr>
				<td style="padding-left:5px;" class="tf"><label for="fcp">Code Postal *</label></td>
				<td colspan="3" class="f"><input size="7" maxlength="5" id="fcp" name="fle1codepostal" type="text"></td>

			</tr>
			<tr>
				<td style="padding-left:5px;" class="tf"><label for="fville">Ville *</label></td>
				<td colspan="3" class="f"><input size="50" maxlength="50" id="fville" name="fle1ville" type="text"></td>
			</tr>
			<tr>
				<td style="padding-left:5px;" class="tf"><label for="fact">Email *</label></td>
				<td colspan="3" class="f"><input size="50" maxlength="50" id="femail" name="flemail" type="text"></td>
			</tr>
            <tr>
				<td style="padding-left:5px;" class="tf"><label for="fact">Téléphone *</label></td>
				<td colspan="3" class="f"><input size="50" maxlength="50" id="ftel" name="fltel" type="text"></td>
			</tr>
            <tr>
				<td width="413" class="cf"><h3>Stage </h3></td>
				<td colspan="3" class="cf">&nbsp;</td>
			</tr>
            <tr>
				<td style="padding-left:5px;" class="tf"><label for="fact">Date de début du stage *</label></td>
				<td colspan="3" class="f"><input size="50" maxlength="50" id="fdds" name="fldds" type="text" onClick="displayCalendar('fdds', event);">
                 <div id="calendar"></div></td>
			</tr>
            <tr>
				<td style="padding-left:5px;" class="tf"><label for="fact">Niveau requis *</label></td>
				<td colspan="3" class="f"><input size="50" maxlength="50" id="fniv" name="flniv" type="text"></td>
			</tr>
            <tr>
				<td style="padding-left:5px;" class="tf"><label for="fact">Durée du stage *</label></td>
				<td colspan="3" class="f"><input size="50" maxlength="50" id="fduree" name="flduree" type="text"></td>
			</tr>
             <tr>
				<td style="padding-left:5px;" class="tf"><label for="fact">Compétences *</label></td>
				<td colspan="3" class="f"><input size="50" maxlength="50" id="fcompt" name="flcompt" type="text"></td>
			</tr>
              <tr>
				<td style="padding-left:5px;" class="tf"><label for="fact">Rénumération</label></td>
				<td colspan="3" class="f"><input size="50" maxlength="50" id="frenum" name="flrenum" type="text"></td>
			</tr>
            <tr>
				<td style="padding-left:5px;" class="tf"><label for="fpe">Mission *</label></td>
				<td colspan="3" class="f"><textarea class="input2" id="fmiss" name="flmiss" cols="50" rows="5"></textarea></td>
			</tr>
       		<tr>	
			<td>&nbsp;</td>		
			</tr>			
			<tr>	
			<td colspan="2" align="center">* : Champs obligatoires</td>		
			</tr>	
			<tr>
          
				<td colspan="2" align="center">
					<input type="submit" value="Valider" id="valider" class="submit2" />&nbsp;&nbsp; 
					<input type="reset"  value="Annuler" name="annuler" ></td>
			</tr>
            <td>&nbsp;</td>
            
		</tbody>

	</table>
</form>
     
        </div>    
        </div>
 		    <div class="clear">
            </div>
<div id="bas">
    				Universit&eacute; d'Evry-Val-d'Essonne Boulevard Fran&ccedil;ois Mitterrand 91025 Evry Cedex <br /> <a href="contacts.php">Contacts</a>|<a href="planSite.php">Plan du site</a>|<a href="informationsLegales.php">Informations l&eacute;gales</a> 
  				</div>
			</div>
		</div>
		<div class="clear"></div>
    	<div class="clear"></div>
	</div>
</body>
</html>
         	<script type="text/javascript">
			function menu(){
				
				document.getElementById('sub').style.display = 'block';
			
			}
			function sortie(){
				
				document.getElementById('sub').style.display = 'none';
			
			}
				
				</script>

<script defer="defer" type="text/javascript">

function verifForm()
{
var entreprise = document.getElementsByName('fent')[0].value;
var adresse = document.getElementsByName('fle1ad1')[0].value;
var codepostal = document.getElementsByName('fle1codepostal')[0].value;
var ville = document.getElementsByName('fle1ville')[0].value;
var email = document.getElementsByName('flemail')[0].value;
var telephone = document.getElementsByName('fltel')[0].value;
var datedebut = document.getElementsByName('fldds')[0].value;
var niveaurequis = document.getElementsByName('flniv')[0].value;
var duree = document.getElementsByName('flduree')[0].value;
var competence = document.getElementsByName('flcompt')[0].value;
var mission = document.getElementsByName('flmiss')[0].value;

var message = "";
if (!entreprise) message+= "Veuillez saisir votre nom d'entreprise !\n";
if (!adresse) message+= "Veuillez saisir votre adresse !\n";
if (!codepostal) message+= "Veuillez saisir votre code postal !\n";
if (!ville) message+= "Veuillez saisir votre ville !\n";
if (!email) message+= "Veuillez saisir votre email !\n";
if (!telephone) message+= "Veuillez saisir votre numéro de téléphone !\n";
if (!datedebut) message+= "Veuillez saisir la date du début du stage !\n";
if (!niveaurequis) message+= "Veuillez saisir le niveau requis !\n";
if (!duree) message+= "Veuillez saisir la durée du stage !\n";
if (!competence) message+= "Veuillez saisir les compétences du stage !\n";
if (!mission) message+= "Veuillez saisir la descrition de la mission !\n";

if(message!=""){
alert(message);
return false;
}
return true;
}
</script> 
